package com.bbcare.comm;

import java.util.Random;
import java.util.UUID;


public class SeqUtil {
       private static final char[] digits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e',
    'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',
    'V', 'W', 'X', 'Y', 'Z'};


    public static String getSeqNoBySize(int size) {
        Random random = new Random();
        char[] cs = new char[size];
        for (int i = 0; i < cs.length; i++) {
            cs[i] = digits[random.nextInt(digits.length)];
        }
        return new String(cs);
    }


    public static String getSeqNo() {
        int size = 18;
        Random random = new Random();
        char[] cs = new char[size];
        for (int i = 0; i < cs.length; i++) {
            cs[i] = digits[random.nextInt(digits.length)];
        }
        return new String(cs);
    }


    public static String getSeqNo(String prefix) {
        int size = 18;
        Random random = new Random();
        char[] cs = new char[size];
        for (int i = 0; i < cs.length; i++) {
            cs[i] = digits[random.nextInt(digits.length)];
        }
        StringBuffer retBuff = new StringBuffer();
        retBuff.append(prefix);
        retBuff.append(cs);
        return retBuff.toString();
    }


    public static String getUuid() {
        UUID uuid = UUID.randomUUID();
        String str = uuid.toString();

        String ustr = str.replaceAll("-", "");
        return ustr;
    }

    public static void main(String[] args) {
        for (int i = 0; i < 13; i++) {
        }
    }
}

